package com.controller;

import com.entity.AnnouncementInfo;
import com.entity.BannerInfo;
import com.service.CarouselNoticeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@RequestMapping("/carNot")
public class CarouselNoticeController {

    @Autowired
    private CarouselNoticeService carouselNoticeService;

    @ApiOperation(value = "查询轮播图")
    @PostMapping(value = "/findBanner")
    @ResponseBody
    public List<BannerInfo> findBanner(Integer type) {
        List<BannerInfo> list = carouselNoticeService.findBanner(type);
        return list;
    }

    @ApiOperation(value = "查询公告")
    @PostMapping(value = "/findAnnouncement")
    @ResponseBody
    public List<AnnouncementInfo> findAnnouncement(Integer type) {
        List<AnnouncementInfo> list = carouselNoticeService.findAnnouncement(type);
        return list;
    }
}
